﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using be.metanous.mvvm.core;

namespace WPFChat.ViewModel
{
    public  class ChatViewModel:ViewModelBase
    {
        public ChatViewModel()
        {
            Messages = new ObservableCollection<MessageViewModel>();
        }
        private ObservableCollection<MessageViewModel> _messages;

        public ObservableCollection<MessageViewModel> Messages
        {
            get { return _messages; }
            private set
            {
                if (_messages != value)
                {
                    _messages = value;
                    RaisePropertyChanged(() => Messages);
                }
            }
        }

        private string _newMessage;

        public string NewMessage
        {
            get { return _newMessage; }
            set
            {
                if (_newMessage != value)
                {
                    _newMessage = value;
                    RaisePropertyChanged(() => NewMessage);
                }
            }
        }

        private CommandViewModel _sendCommand;

        public CommandViewModel SendCommand
        {
            get { return _sendCommand; }
            set
            {
                if (_sendCommand != value)
                {
                    _sendCommand = value;
                    RaisePropertyChanged(() => SendCommand);
                }
            }
        }

        
    }
}
